var timer;
var autoTimer;
(global.webpackJsonp = global.webpackJsonp || []).push([
  ["wjyk_recycle/pages/recycle-confirm/recycle-confirm"], {
    "4c10": function (e, t, i) {
      i.r(t);
      var r, c = i("4c44"),
        s = i("7f9c");
      for (r in s) "default" !== r && function (e) {
        i.d(t, e, function () {
          return s[e];
        });
      }(r);
      i("cb21");
      var a = i("f0c5"),
        c = Object(a.a)(s.default, c.b, c.c, !1, null, null, null, !1, c.a, void 0);
      t.default = c.exports;
    },
    "4c44": function (e, t, i) {
      function r() {
        var e = this,
          t = (e.$createElement, e._self._c, Number(e.totalPrice).toFixed(2)),
          i = Number(e.profitPrice).toFixed(2);
        e.$mp.data = Object.assign({}, {
          $root: {
            g0: t,
            g1: i
          }
        });
      }
      var c = [];
      i.d(t, "b", function () {
        return r;
      }), i.d(t, "c", function () {
        return c;
      }), i.d(t, "a", function () {});
    },
    "6c5b": function (e, t, i) {
      (function (e) {
        function t(e) {
          return e && e.__esModule ? e : {
            default: e
          };
        }
        i("8163"), t(i("66fd")), e(t(i("4c10")).default);
      }).call(this, i("543d").createPage);
    },
    "7f9c": function (e, t, i) {
      i.r(t);
      var r, c = i("d22f"),
        s = i.n(c);
      for (r in c) "default" !== r && function (e) {
        i.d(t, e, function () {
          return c[e];
        });
      }(r);
      t.default = s.a;
    },
    "964f": function (e, t, i) {},
    cb21: function (e, t, i) {
      var r = i("964f");
      i.n(r).a;
    },
    d22f: function (e, i, r) {
      (function (a) {
        Object.defineProperty(i, "__esModule", {
          value: !0
        }), i.default = void 0;
        var o = e(r("4795")),
          l = e(r("5438"));

        function e(e) {
          return e && e.__esModule ? e : {
            default: e
          };
        }

        function n(e, t, i, r, c, s, a) {
          try {
            var o = e[s](a),
              l = o.value;
          } catch (e) {
            return i(e), 0;
          }
          o.done ? t(l) : Promise.resolve(l).then(r, c);
        }

        function u(o) {
          return function () {
            var e = this,
              a = arguments;
            return new Promise(function (t, i) {
              var r = o.apply(e, a);

              function c(e) {
                n(r, t, i, c, s, "next", e);
              }

              function s(e) {
                n(r, t, i, c, s, "throw", e);
              }
              c(void 0);
            });
          };
        }
        var t = {
          data: function () {
            return {
              huishouImg: '',
              pic_url: this.$imgUrl,
              name: "",
              orderid: "",
              orderList: [],
              collectorid: "",
              cateList: [],
              typeList: [],
              multiArray: [],
              multiIndex: [0, 0, 0],
              is_offline: "",
              firstVal: "",
              firstId: "",
              secondVal: "",
              secondId: "",
              number: "",
              unit: "",
              price: "",
              partnerid: "",
              user_price: "",
              collector_price: 0,
              totalPrice: 0,
              recyclePrice: 0,
              profitPrice: 0,
              devices: [],
              // devices: [
              //   {
              //     deviceId: '158f55d5d5fs8df8sf8df8dsf8',
              //     name: '2222222222',
              //     RSSI: '1000'
              //   },
              //   {
              //     deviceId: '158f55d5d5fs8df8sf8df8dsf8',
              //     name: '2222222222',
              //     RSSI: '1000'
              //   },
              //   {
              //     deviceId: '158f55d5d5fs8df8sf8df8dsf8',
              //     name: '2222222222',
              //     RSSI: '1000'
              //   }
              // ],
              ids: [],
              connected: false,
              chs: [],
              misScanding: false,
              scandbutName: "搜索蓝牙设备",
              zhi: '',
              ble_device: '', //蓝牙设备
              globalData: {
                mserviceuuid: "0000FFE0-0000-1000-8000-00805F9B34FB",
                mtxduuid: "0000FFE1-0000-1000-8000-00805F9B34FB",
                mrxduuid: "0000FFE1-0000-1000-8000-00805F9B34FB",
                /*
                mserviceuuid: "0000FFE0-0000-1000-8000-00805F9B34FB", //hc08
                mtxduuid: "0000FFE1-0000-1000-8000-00805F9B34FB",
                mrxduuid: "0000FFE1-0000-1000-8000-00805F9B34FB",*/
                usrserviceuuid: "0000FFE0-0000-1000-8000-00805F9B34FB",
                usrtxduuid: "0000FFE1-0000-1000-8000-00805F9B34FB",
                usrrxduuid: "0000FFE1-0000-1000-8000-00805F9B34FB",
                muuidSel: 0,
                mautoSendInv: 10,
                msendText: "",
               
                
              },
              device:'',
              readyRec:false,
              rxRate: 0,
              txRate: 0,
              timRX: 0,
              timTX: 0,
              windowHeight:'',
              scrollViewHeight:'',
              connectState:'',
              canWrite : '' ,  
              _deviceId: '' ,
              _characteristicId : '' ,
              _serviceId : '' ,
              recdata:'',
            };
          },
          onShow: function () {
            l.default.releaseKey("submit"), this.collectorSet();
          },
          onLoad: function (e) {
            this.name = a.getStorageSync("name"), this.orderid = e.orderid, this.collectorid = e.collectorid,
              this.partnerid = e.partnerid, console.log("options", e), this.reserveOrderDetail(),
              this.reserveCateList();
          },
          methods: {
            getImageInfo: function(t) {
              console.info(t), this.huishouImg = "";
              for (var e = 0; e < t.length; e++) {
                  if (e == t.length - 1) return void (this.huishouImg += t[e]);
                  this.huishouImg += t[e] + ",";
              }
            },
            ceshi(){
              console.info(this.huishouImg,'huishouImg')
            },
            changeItemPrice(e){
              let index = e.currentTarget.dataset.index
              this.cateList[index].price = e.detail.value
              this.getPrice1()
            },
            changePrice(e){
              console.info(e.detail.value,'changePrice')
              this.totalPrice = e.detail.value
            },
            collectorSet: function () {
              var i = this;
              return u(o.default.mark(function e() {
                var t;
                return o.default.wrap(function (e) {
                  for (;;) switch (e.prev = e.next) {
                    case 0:
                      return e.next = 2, i.$http({
                        url: i.$api.collectorSet
                      });

                    case 2:
                      0 == (t = e.sent).errno && (i.is_offline = t.data.is_offline);

                    case 4:
                    case "end":
                      return e.stop();
                  }
                }, e);
              }))();
            },
            changeInput: function (e) {
             
              if (1 != e.target.value.indexOf(".", e.target.value.length - 1)) {
                var t = e.currentTarget.dataset.index,
                  e = e.detail.value;
                 
                this.cateList[t].number = Number(Number(e).toFixed(2)), this.cateList[t].price = (this.cateList[t].number * Number(this.cateList[t].user_price)).toFixed(2);
                for (var i = 0; i < this.cateList.length; i++) 0 == i ? (this.totalPrice = Number(Number(this.cateList[i].price).toFixed(2)),
                  this.recyclePrice = Number((this.cateList[i].number * Number(this.cateList[i].collector_price)).toFixed(2))) : (this.totalPrice += Number(Number(this.cateList[i].price).toFixed(2)),
                  this.recyclePrice += Number((this.cateList[i].number * Number(this.cateList[i].collector_price)).toFixed(2)));
                this.profitPrice = Number((Number(this.recyclePrice) - Number(this.totalPrice)).toFixed(2)),
                  console.log("数量", this.profitPrice, this.totalPrice, this.cateList);
                 
              }
            },
            getPrice: function (e) {
              var t = e.currentTarget.dataset.index,
                e = Number(e.detail.value);
              this.user_price = Number(e), console.log("操作的下标：", t, e), this.cateList[t].user_price = e || 0;
              for (var i = 0, r = 0, c = 0; c < this.cateList.length; c++) {
                var s = Number(this.cateList[c].user_price),
                  a = Number(this.cateList[c].number),
                  o = Number(this.cateList[c].collector_price);
                this.cateList[c].price = (a * s).toFixed(2), i += s * a;
                var l = o - s;
                r += l * a, console.log("99999999--------", s, a, o, i, l, r);
              }
              this.totalPrice = i, this.profitPrice = r, console.log("价格getPrice", i, r);
            },
            bindMultiPickerChange: function (e) {
              var t = 0;
              console.log("==============", e, e.detail, this.cateList), console.log("第一个值", this.multiArray[0][e.detail.value[0]].name, this.multiArray[0][e.detail.value[0]].id),
                console.log("第二个值", this.multiArray[1][e.detail.value[1]], this.multiArray[1][e.detail.value[1]].name, this.multiArray[1][e.detail.value[1]].id),
                console.log("第三个值", this.multiArray[2], this.multiArray[2][e.detail.value[2]].collector_price),
                this.firstVal = this.multiArray[0][e.detail.value[0]].name, this.firsId = this.multiArray[0][e.detail.value[0]].id,
                this.secondVal = this.multiArray[1][e.detail.value[1]].name, this.secondId = this.multiArray[1][e.detail.value[1]].id,
                this.unit = this.multiArray[1][e.detail.value[1]].unit, this.user_price = this.multiArray[2][e.detail.value[2]].user_price,
                this.collector_price = this.multiArray[2][e.detail.value[2]].collector_price;
              for (var i = 0; i < this.cateList.length; i++) this.cateList[i].firsId == this.firsId && this.cateList[i].secondId == this.secondId && (this.cateList[i].number = this.cateList[i].number + 1,
                this.cateList[i].price = (this.cateList[i].number * this.cateList[i].user_price).toFixed(2),
                this.totalPrice = (Number(this.totalPrice) + Number(this.cateList[i].price)).toFixed(2),
                this.recyclePrice = (Number(this.recyclePrice) + Number(this.cateList[i].collector_price)).toFixed(2),
                this.profitPrice = (Number(this.recyclePrice) - Number(this.totalPrice)).toFixed(2),
                t = 1, console.log("11111111111111", Number(this.recyclePrice), Number(this.cateList[i].collector_price)));
              0 == t && (this.totalPrice = (Number(this.totalPrice) + Number(this.user_price)).toFixed(2),
                this.recyclePrice = (Number(this.recyclePrice) + Number(this.collector_price)).toFixed(2),
                this.profitPrice = (Number(this.recyclePrice) - Number(this.totalPrice)).toFixed(2),
                console.log("2222222222222", Number(this.recyclePrice), Number(this.collector_price)),
                this.cateList.push({
                  firsId: this.firsId,
                  firstVal: this.firstVal,
                  secondId: this.secondId,
                  secondVal: this.secondVal,
                  price: this.user_price,
                  number: 1,
                  unit: this.unit,
                  user_price: this.user_price,
                  collector_price: this.collector_price,
                  // totalMoney: this.user_price * 1
                  // totalMoney: 0
                })), console.log("------------", this.cateList);

                this.getPrice1();
            },
            bindMultiPickerColumnChange: function (e) {
              console.log("修改的列为", e, e.detail.column, "，值为", e.detail.value), 0 == e.detail.column && (this.multiIndex[0] = e.detail.value,
                this.multiIndex[1] = 0, this.multiIndex[2] = 0, console.log("aaaaaaaaaaaaaaa", this.multiIndex),
                this.setRange()), 1 == e.detail.column && (this.multiIndex[1] = e.detail.value,
                this.multiIndex[2] = e.detail.value, console.log("bbbbbbbbbbbbb", this.multiIndex),
                this.setRange());
            },
            setRange: function () {
              var t = [
                [],
                [],
                []
              ];
              this.typeList.forEach(function (e) {
                console.log("000", e, t), t[0].push({
                  id: e.id,
                  name: e.name
                });
              }), this.typeList[this.multiIndex[0]].children.forEach(function (e) {
                t[1].push({
                  id: e.id,
                  name: e.name,
                  unit: e.unit
                });
              }), this.typeList[this.multiIndex[0]].children[this.multiIndex[1]].children.forEach(function (e) {
                t[2].push({
                  name: e.reference,
                  user_price: e.user_price,
                  collector_price: e.collector_price
                });
              }), this.multiArray = t, this.$forceUpdate();
            },
            bidConfirm: function (c) {
              var s = this;
              return u(o.default.mark(function e() {
                var t, i, r;
                return o.default.wrap(function (e) {
                  for (;;) switch (e.prev = e.next) {
                    case 0:
                      if (t = !0, 0 == s.cateList.length) return s.$sun.toast("请添加物品"), t = !1, e.abrupt("return");
                      e.next = 5;
                      break;

                    case 5:
                      r = i = 0;

                    case 7:
                      if (!(r < s.cateList.length)) {
                        e.next = 19;
                        break;
                      }
                      if (console.log("11111", s.cateList[r], s.cateList[r].price), null == s.cateList[r].user_price || "" == s.cateList[r].user_price || null == s.cateList[r].user_price) return s.$sun.toast("请输入回收价格"),
                        t = !1, e.abrupt("return");
                      e.next = 15;
                      break;

                    case 15:
                      console.info(i,'zouleme')
                      i += Number(s.cateList[r].price);

                    case 16:
                      r++, e.next = 7;
                      break;

                    case 19:
                      console.info("分类内容", s.cateList, i), 
                      t && l.default.uniDoFunc({
                        key: "submit",
                        success: function () {
                          var e = u(o.default.mark(function e() {
                            return o.default.wrap(function (e) {
                              for (;;) switch (e.prev = e.next) {
                                case 0:
                                  l.default.lockKey("submit"), console.log("防抖... 在事件触发前连续点击事件会重新计时"), s.$http({
                                    url: s.$api.collectorRecycleSure,
                                    data: {
                                      orderid: s.orderid,
                                      collectorid: s.collectorid,
                                      actual: s.cateList,
                                      // total: i.toFixed(2),
                                      photos: s.huishouImg,//回收图片
                                      total: s.totalPrice,
                                      pay_type: c
                                    }
                                  }).then(function (e) {
                                    console.log("res11111111", e), a.showModal({
                                      title: "提示",
                                      showCancel: !1,
                                      content: e.message,
                                      success: function (e) {
                                        if (e.confirm) l.default.releaseKey("submit"), a.navigateBack({
                                          delta: 1
                                        });
                                        else if (e.cancel) return;
                                      }
                                    });
                                  }).catch(function (e) {
                                    a.showModal({
                                      title: "提示",
                                      showCancel: !1,
                                      content: e.data.message,
                                      success: function (e) {
                                        if (e.confirm) console.log("=========================="), l.default.releaseKey("submit"),
                                          a.navigateTo({
                                            url: "/wjyk_recycle/pages/recycle-center/recycle-center?collectorid=" + s.collectorid
                                          });
                                        else if (e.cancel) return;
                                      }
                                    });
                                  });

                                case 3:
                                case "end":
                                  return e.stop();
                              }
                            }, e);
                          }));
                          return function () {
                            return e.apply(this, arguments);
                          };
                        }()
                      });

                    case 21:
                    case "end":
                      return e.stop();
                  }
                }, e);
              }))();
            },
            //蓝牙
            lianjie: function (e, t) {
              wx.openBluetoothAdapter({
                success: (res) => {
                  console.info(res,'成功')
                  this.startBluetoothDevicesDiscovery()
                },
                fail: (res) => {
                  console.info(res,'失败')
                  if (res.errCode === 10001) {
                    wx.onBluetoothAdapterStateChange(function (res) {
                      if (res.available) {
                        this.startBluetoothDevicesDiscovery()
                      }
                    })
                  }
                }
              })
            },
            startBluetoothDevicesDiscovery() {
              var that = this;
              if (this._discoveryStarted) {
                this.stopBluetoothDevicesDiscovery()
                return
              }

              this.misScanding = true;
              this.scandbutName = "正在搜索，点击停止";
              this.devices = [];
              this.chs = [];

              this._discoveryStarted = true
              wx.startBluetoothDevicesDiscovery({
                allowDuplicatesKey: true,
                success: (res) => {
                  setTimeout(function () {

                    if (that._discoveryStarted) {
                      that.stopBluetoothDevicesDiscovery()
                    }
                  }, 20000);

                  this.onBluetoothDeviceFound()
                },
              })
            },
            stopBluetoothDevicesDiscovery() {
              this._discoveryStarted = false
              wx.stopBluetoothDevicesDiscovery()
              this.setData({
                misScanding: false,
                scandbutName: "重新刷新列表",
              })
              //console.log('lisn3188---------- misScanding = ', this.misScanding)
            },
            onBluetoothDeviceFound() {
              wx.onBluetoothDeviceFound((res) => {
                // console.info(res.devices,'onBluetoothDeviceFound')

                res.devices.forEach(device => {
                  if (!device.name && !device.localName) {
                    return
                  }
                  const foundDevices = this.devices

                  // const idx = foundDevices.indexOf(device.deviceId)
                  var kg = true;
                  for (var i = 0; i < foundDevices.length; i++) {
                    if (device.deviceId == foundDevices[i]['deviceId']) {

                      kg = false;
                    }
                  }
                  if (kg) {
                    this.devices.push(device)
                  }

                  // const data = {}
                  // if (idx === -1) {
                  //   data[`devices[${foundDevices.length}]`] = device
                  // } else {
                  //   data[`devices[${idx}]`] = device
                  // }

                  // this.devices = data
                })
              })
            },
            //点击蓝牙设备
            goto_Comm(e) {

              this.ble_device = e
              this.stopBluetoothDevicesDiscovery()
              this.readSetting();

              this.device = this.ble_device
              this.readyRec = false
              this.autoSendInv = this.globalData.mautoSendInv
              this.sendText = this.globalData.msendText
             
              // console.log("start ", this.data.autoSendInv, this.data.sendText)
              this.Countdown()
              //this.showModalTips("开始连接设备....")
              if (this.device == null) {
                this.calScrolHigh()
                return
              }
              const deviceId = this.device.deviceId
              this.deviceadd =  "MAC " + deviceId
      
              this.calScrolHigh()
              const name = this.device.name

              this.serviceu = this.globalData.mserviceuuid.toUpperCase()
              this.txdu = this.globalData.mtxduuid.toUpperCase()
              this.rxdu = this.globalData.mrxduuid.toUpperCase()
            
              wx.setNavigationBarTitle({
                title: "正在连接 " + this.device.name
              })
              wx.createBLEConnection({
                deviceId,
                success: (res) => {

                  // this.setData({
                  //   connected: true,
                  //   name,
                  //   deviceId,
                  //   connectState: "读取服务",
                  //   reconnect: "断开连接"
                  // })
                  wx.setNavigationBarTitle({
                    title: "已连接 " + this.device.name
                  })
                  this.lianjie = true
                  //this.showModalTips("读取BLE所有服务")
                  this.getBLEDeviceServices(deviceId)
                }
              })
            },
            getBLEDeviceServices(deviceId) {
              var that = this
              this.readyRec = false
              wx.getBLEDeviceServices({
                deviceId,
                success: (res) => {
                  var isService = false
    
                  for (let i = 0; i < res.services.length; i++) {
                    // if (res.services[i].isPrimary) {
                    if (this.serviceu == res.services[i].uuid) {
                      //this.showModalTips(this.serviceu+"\r找到服务UUID，正在读取所有特征值")
                      isService = true
                      this.getBLEDeviceCharacteristics(deviceId, res.services[i].uuid)
                      this.connectState = "获取特征值"
                     
                    }
                  }
                  if (!isService) { //没有找到服务
  
                    this.connectState = "UUID错误"
                    this.showModalTips(this.serviceu + "\r找不到目标服务UUID  请确认UUID是否设置正确或重新连接")
                  }
                }
              })
            },
            getBLEDeviceCharacteristics(deviceId, serviceId) {
              const that = this
              wx.getBLEDeviceCharacteristics({
                deviceId,
                serviceId,
                success: (res) => {
                  var ismy_service = false
             
                  if (serviceId == this.serviceu) {
                    ismy_service = true
                    console.warn("this is my service ")
                  }
                  
                  for (let i = 0; i < res.characteristics.length; i++) {
                    let item = res.characteristics[i]
                    if (ismy_service) {
                   
                    }
                   
                    if (item.properties.read) {
                     
                      wx.readBLECharacteristicValue({
                        deviceId,
                        serviceId,
                        characteristicId: item.uuid,
                      })
                    }
                    if (item.properties.write) {
                      this.canWrite = true
    
                      this._deviceId = deviceId
                      if (ismy_service && (this.txdu == item.uuid)) {
                       
                        this._characteristicId = item.uuid
                        this._serviceId = serviceId
                        // this.showModalTips(this.txdu+ "\r找到发送特征值")
                      }
                      //this.writeBLECharacteristicValue()
                    }
                    if (item.properties.notify || item.properties.indicate) {
             
                      if (ismy_service && (this.rxdu == item.uuid)) {
                       
                        // this.showModalTips(this.rxdu + "\r正在开启通知...")
                        wx.notifyBLECharacteristicValueChange({ //开启通知
                          deviceId,
                          serviceId,
                          characteristicId: item.uuid,
                          state: true,
                          success(res) {
                         
                            that.connectState = "连接成功"
                            
                            // that.showModalTips(that.rxdu + "\r开启通知成功")
                            that.readyRec = true
                          }
                        })
                      }
                    }
                  }
                },
                fail(res) {
                  console.info('getBLEDeviceCharacteristics', res)
                }
              })
              // 操作之前先监听，保证第一时间获取数据
              wx.onBLECharacteristicValueChange((characteristic) => {
                var buf = new Uint8Array(characteristic.value)
                var nowrecHEX = this.ab2hex(characteristic.value)
               
                var recStr = this.ab2Str(characteristic.value)
               
                if (this.rxdu != characteristic.characteristicId) {
                  console.error("no same : ", this.rxdu, characteristic.characteristicId)
                  return
                }
                if (!this.readyRec) return
                var mrecstr
                if (this.hexRec) {
                  mrecstr = nowrecHEX
                } else {
                  mrecstr = recStr
                }
              
               
                this.recdata = mrecstr.substr(1,7)
                this.recdata = this.recdata.split('').reverse().join('')
                this.recdata = parseFloat(this.recdata)
           
                this.rxCount =this.rxCount + buf.length
                this.timRX =this.timRX + buf.length
                
              })
            },
            ab2Str(arrayBuffer) {
              let unit8Arr = new Uint8Array(arrayBuffer);
              let encodedString = String.fromCharCode.apply(null, unit8Arr);
              //var decodedString = decodeURIComponent(mencode.encodeURIComponent((encodedString)));//没有这一步中文会乱码
              //var decodedString = mencode.encodeURIComponent((encodedString));
              //console.log(decodedString);
              //return decodedString
              return encodedString
            },
            // ArrayBuffer转16进度字符串示例
            ab2hex(buffer) {
              var hexArr = Array.prototype.map.call(
                new Uint8Array(buffer),
                function (bit) {
                  return ('00' + bit.toString(16)).slice(-2) + " "
                }
              )
              return (hexArr.join('')).toUpperCase();
            },
            calScrolHigh() {
              var that = this
              // 先取出页面高度 windowHeight
              wx.getSystemInfo({
                success: function (res) {
                  that.windowHeight = res.windowHeight
                }
              });
              // 然后取出navbar和header的高度
              // 根据文档，先创建一个SelectorQuery对象实例
              let query = wx.createSelectorQuery().in(this);
              // 然后逐个取出navbar和header的节点信息
              // 选择器的语法与jQuery语法相同
              query.select('#v1').boundingClientRect();
              query.select('#v2').boundingClientRect();
              query.select('#v3').boundingClientRect();
              query.select('#v4').boundingClientRect();
              query.select('#v5').boundingClientRect();
              // 执行上面所指定的请求，结果会按照顺序存放于一个数组中，在callback的第一个参数中返回
              query.exec((res) => {
                // 分别取出navbar和header的高度
                let navbarHeight = res[0].height + res[4].height;
                let headerHeight = res[1].height + res[2].height + res[3].height + 15;
                // 然后就是做个减法
                let scrollViewHeight = this.windowHeight - navbarHeight - headerHeight;
                // 算出来之后存到data对象里面
                this.scrollViewHeight = scrollViewHeight
              
              });
            },
            Countdown() {
              var that = this;
              timer = setTimeout(function () {
                that.rxRate = that.timRX * 2
                that.txRate = that.timTX * 2
                that.timRX = 0
                that.timTX = 0
                that.Countdown();
              }, 500);
            },
            //读取设置
            readSetting: function () {
              this.readUUID()
              this.globalData.mautoSendInv = wx.getStorageSync('autoSendInv') || 100
              this.globalData.msendText = wx.getStorageSync('sendText') || "1024"
              this.globalData.muuidSel = wx.getStorageSync('lastsel') || 0
              switch (this.globalData.muuidSel) {
                case 0:
                  this.globalData.mserviceuuid = "0000FFE0-0000-1000-8000-00805F9B34FB"
                  this.globalData.mtxduuid = "0000FFE1-0000-1000-8000-00805F9B34FB"
                  this.globalData.mrxduuid = "0000FFE1-0000-1000-8000-00805F9B34FB"
                  break;
                case 1:
                  this.globalData.mserviceuuid = "0000FFE0-0000-1000-8000-00805F9B34FB"
                  this.globalData.mtxduuid = "0000FFE2-0000-1000-8000-00805F9B34FB"
                  this.globalData.mrxduuid = "0000FFE1-0000-1000-8000-00805F9B34FB"
                  break;
                case 2:
                  this.globalData.mserviceuuid = this.globalData.usrserviceuuid
                  this.globalData.mtxduuid = this.globalData.usrtxduuid
                  this.globalData.mrxduuid = this.globalData.usrrxduuid
                  break;
              }
              console.info("readSetting ", this.globalData.mautoSendInv, this.globalData.msendText)
            },
            readUUID: function () {
              this.globalData.usrserviceuuid = wx.getStorageSync('usrserviceuuid') || "0000FFE0-0000-1000-8000-00805F9B34FB"
              this.globalData.usrrxduuid = wx.getStorageSync('usrrxduuid') || "0000FFE1-0000-1000-8000-00805F9B34FB"
              this.globalData.usrtxduuid = wx.getStorageSync('usrtxduuid') || "0000FFE1-0000-1000-8000-00805F9B34FB"
              this.globalData.muuidSel = wx.getStorageSync('lastsel') || 0
              console.info(this.globalData.usrrxduuid)
              console.info("Read = ", this.globalData.usrserviceuuid, this.globalData.usrtxduuid, this.globalData.usrrxduuid)
            },
            //停止搜索蓝牙
            stopBluetoothDevicesDiscovery() {
              this._discoveryStarted = false
              wx.stopBluetoothDevicesDiscovery()
              this.misScanding = false;
              this.scandbutName = "重新刷新列表";

            },
            reduce: function (e, t) {
              1 < e && (this.cateList[t].number = e - 1, this.cateList[t].price = (this.cateList[t].number * this.cateList[t].user_price).toFixed(2),
                  this.totalPrice = (Number(this.totalPrice) - Number(this.cateList[t].user_price)).toFixed(2),
                  this.recyclePrice = (Number(this.recyclePrice) - Number(this.cateList[t].collector_price)).toFixed(2),
                  this.profitPrice = (Number(this.recyclePrice) - Number(this.totalPrice)).toFixed(2)),
                console.log("=========", Number(this.totalPrice), Number(this.cateList[t].user_price)),
                console.log("点击减号", e, this.cateList[t], this.cateList);
            },
            add: function (e, t) {
              this.cateList[t].number = Number(e) + 1, this.cateList[t].price = (this.cateList[t].number * this.cateList[t].user_price).toFixed(2),
                this.totalPrice = (Number(this.totalPrice) + Number(this.cateList[t].user_price)).toFixed(2),
                this.recyclePrice = (Number(this.recyclePrice) + Number(this.cateList[t].collector_price)).toFixed(2),
                this.profitPrice = (Number(this.recyclePrice) - Number(this.totalPrice)).toFixed(2),
                console.log("点击加号", e, this.cateList[t], this.cateList);
            },
            dianzi:function(e, t){
              console.info(e,t,this.cateList,this.recdata,'this.cateList',this.totalPrice,this.recyclePrice,this.profitPrice)
              this.cateList[t].number = this.recdata, this.cateList[t].price = (this.cateList[t].number * this.cateList[t].user_price).toFixed(2),
               
              this.getPrice1()
              
            },
            getPrice1: function () {
              var price = 0;
              for (var i = 0, r = 0, c = 0; c < this.cateList.length; c++) {
                var s = Number(this.cateList[c].user_price),
                  a = Number(this.cateList[c].number),
                  o = Number(this.cateList[c].collector_price);
                // this.cateList[c].price = (a * s).toFixed(2), i += s * a;
                var l = o - s;
                r += l * a, console.log("99999999--------", s, a, o, i, l, r);
                price+=Number(this.cateList[c].price)
              }
              this.totalPrice = price, this.profitPrice = r, console.log("价格getPrice", i, r);
            },
            deleteList: function (e) {
              console.log("this.cateList[index]", this.cateList[e]), this.totalPrice = (Number(this.totalPrice) - this.cateList[e].number * Number(this.cateList[e].user_price)).toFixed(2),
                this.recyclePrice = (Number(this.recyclePrice) - this.cateList[e].number * Number(this.cateList[e].collector_price)).toFixed(2),
                this.profitPrice = (Number(this.recyclePrice) - Number(this.totalPrice)).toFixed(2),
                this.cateList.splice(e, 1), console.log("点击了删除", e, this.cateList);
            },
            reserveCateList: function () {
              var i = this;
              return u(o.default.mark(function e() {
                var t;
                return o.default.wrap(function (e) {
                  for (;;) switch (e.prev = e.next) {
                    case 0:
                      return e.next = 2, i.$http({
                        url: i.$api.reserveCateList,
                        data: {
                          partnerid: i.partnerid
                        }
                      });

                    case 2:
                      0 == (t = e.sent).errno && (i.typeList = t.data, console.log("回收类型列表", t, i.typeList),
                        i.setRange());

                    case 4:
                    case "end":
                      return e.stop();
                  }
                }, e);
              }))();
            },
            reserveOrderDetail: function () {
              var i = this;
              return u(o.default.mark(function e() {
                var t;
                return o.default.wrap(function (e) {
                  for (;;) switch (e.prev = e.next) {
                    case 0:
                      return e.next = 2, i.$http({
                        url: i.$api.reserveOrderDetail,
                        data: {
                          id: i.orderid
                        }
                      });

                    case 2:
                      // let arr = t.data.actual.map(item => {
                      //   return {
                      //     ...item,
                      //     totalMoney: item.price
                      //   }
                      // }),
                      
                      0 == (t = e.sent).errno && (1 == t.data.flag && (i.cateList = t.data.actual), 0 == t.data.flag && (i.cateList = t.data.content),
                        i.totalPrice = t.data.total, i.recyclePrice = t.data.collector_total, i.profitPrice = t.data.collector_profit,
                        console.log("回收订单详情", t));

                    case 4:
                    case "end":
                      return e.stop();
                  }
                }, e);
              }))();
            }
          },
          onUnload: function(){
            console.info('离开页面')
            // 离开页面关闭蓝牙
            wx.closeBluetoothAdapter({
              success (res) {
                console.info(res,'closeBluetoothAdapter')
              }
            })
          }
        };
        i.default = t;
      }).call(this, r("543d").default);
    }
  },
  [
    ["6c5b", "common/runtime", "common/vendor"]
  ]
]);